from django.http import HttpResponse
from django.template import Context,loader
from django.shortcuts import render_to_response
from game.monster.models import individual
from game.combat.models import combatant

def getIndThumb(request, ind):
	response = HttpResponse()
	c=Context()
	t=loader.get_template('monster/indThumb.html')
	try:
		if isinstance(ind, individual):
			ind = ind
		elif not isinstance(ind, combatant):
			ind = individual.objects.get(id = ind)
		else: ind = ind.individual
		c['individual']=ind
		response.write(loader.render_to_string('monster/indThumb.html',c))
		return response
	except Exception,e:
		print e
		return response
